import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15  // ← 这是 RowLayout 所属模块


ApplicationWindow {
    visible: true
    width: 1000
    height: 650
    title: "Logcat Viewer"

    ColumnLayout {
        anchors.fill: parent
        spacing: 10
        // padding: 10

        RowLayout {
            spacing: 5
            Label { text: "ADB Path:" }
            TextField { id: adbPathField; Layout.fillWidth: true; text: "adb" }
            Label { text: "Filterspec:" }
            TextField { id: filterspecField; text: "*" }
            Label { text: "Buffer:" }
            TextField { id: bufferField; text: "main" }
        }

        RowLayout {
            spacing: 5
            Label { text: "Format:" }
            TextField { id: formatField; text: "threadtime" }
            Label { text: "PID:" }
            TextField { id: pidField }
            Label { text: "Lines (-t):" }
            TextField { id: linesField }
            Label { text: "Dump (-d):" }
            CheckBox { id: dumpCheckBox }
            Label { text: "Regex (-e):" }
            TextField { id: regexField }
        }

        RowLayout {
            spacing: 5
            Button { text: "Start"; onClicked: python.logcatStart() }
            Button { text: "Stop"; onClicked: python.logcatStop() }
            Button { text: "Clear"; onClicked: python.clearLog() }
        }

        TextArea {
            id: logArea
            Layout.fillWidth: true
            Layout.fillHeight: true
            readOnly: true
        }
    }
}
